<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/" 
      xmlns:xi="http://www.w3.org/2001/XInclude">
  <xi:include href="admin.html" />
  <head>
    <title>Backends</title>
  </head>

  <body>
    <h2>Manage Repositories</h2>

    <form class="addnew" method="post">
      <fieldset>
        <legend>Add/Edit Repository:</legend>
        <div class="field">
          <label>Repository Type:<br />
            <select id="type" name="type">
              <option value="svn">svn</option>
            </select>
          </label>
        </div>
        <div class="field">
          <label>Name:<br />
            <input type="text" name="name" id="name" class="textwidget" value="" />
          </label>
        </div>
        <div class="field">
          <label>Repository URL:<br />
            <input type="text" name="url" id="url" class="textwidget" value="" />
          </label>
        </div>
        <div class="field">
          <label>Browse URL:<br />
            <input type="text" name="browseurl" id="browseurl" class="textwidget" value="" />
          </label>
        </div>
        <div class="field">
          <label>Username:<br />
            <input type="text" name="username" id="username" class="textwidget" value="" />
          </label>
        </div>
        <p class="help">Add a new repository. Available variables in all fields except Username
          get replaced by their actual values.<br /><br />
          Available variables:<br />
          %OWNER% = Buildjob owner<br />
          %PORTNAME% = Portname<br />
          %QUEUEID% = Buildqueue ID<br />
          %BUILDID% = Build ID<br /> 
        </p>
        <div class="buttons">
          <input type="submit" name="add" value="Add" />
        </div>
      </fieldset>
    </form>

    <div id="repositorylist" style="overflow: auto; padding: 0 1px;" >
      <table class="listing" id="backendlist">
        <thead>
          <tr>
            <th>Type</th>
            <th>Name</th>
            <th>Repository URL</th>
            <th>Browse URL</th>
            <th>Username</th>
            <th>Options</th>
          </tr>
        </thead>
        <tbody>
          <tr py:for="repository in repositories">
            <td>${repository.type}</td>
            <td>${repository.name}</td>
            <td>${repository.url}</td>
            <td>${repository.browseurl}</td>
            <td>${repository.username}</td>
            <td>
              <form method="post" action="">
                <input type="hidden" name="id" value="$repository.id" />
                <input type="submit" name="delete" value="delete" />
              </form>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  </body>
</html>
